﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BE;
using DAL;
using BE.SearchCriteria;

namespace BLL
{
    public class AreaBLL : BaseBLL
    {
        public static List<AreaBE> SeleccionarTodos(BaseSC pAreaSC, int pPageSize, int? pPageNum, ref int pCountReg)
        {
            AreaDAL oAreaDAL = new AreaDAL();
            return oAreaDAL.SeleccionarPorParametros(pAreaSC, pPageSize, pPageNum, ref pCountReg);
        }

        public static void Insertar(AreaBE pElemBE)
        {
            try
            {
                Validar(pElemBE);

                AreaDAL oAreaDAL = new AreaDAL();
                oAreaDAL.Insertar(pElemBE);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex))
                    throw;
            }
        }

        public static void Modificar(AreaBE pElemBE)
        {
            try
            {
                Validar(pElemBE);

                AreaDAL oAreaDAL = new AreaDAL();
                oAreaDAL.Modificar(pElemBE);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex))
                    throw;
            }
        }

        public static void Delete(int pIdArea)
        {
            try
            {
                AreaDAL oAreaDAL = new AreaDAL();
                oAreaDAL.Delete(pIdArea);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex))
                    throw;
            }
        }
        private static void Validar(AreaBE pElemBE)
        {

        }

    }
}
